<template>
	<view class="list-content">
		<view class="list">
			<view class="li" @tap="toAlterMessage()">
				<view class="text">信息修改</view>
				<image class="to" src="/static/to.png"></image>
			</view>

			<view class="li" @tap="logout()">
				<view class="text">退出登录</view>
				<image class="to" src="/static/to.png"></image>
			</view>
		</view>
	</view>
</template>

<script>
	import base from '@/common/base.js'
	export default{
		methods:{
			toAlterMessage(){
				uni.navigateTo({
					url:'/pages/user/intelligence/identification'
				})
			},
			logout(){
				uni.showModal({
					content:'你确定要退出吗？',
					success: (res) => {
						if(res.confirm){
							base.coach=null
							uni.request({
								url:base.urlPrefix+"yoga_app/coach-info/coachLogout"
							});
							uni.reLaunch({
								url:'/pages/login/login'
							})
						}
					}
				})
			}
		}
	}
</script>

<style lang="scss">
	.list-content {
		background: #fff;
	}

	.list {
		width: 100%;
		border-bottom: 15upx solid #f1f1f1;
		background: #fff;

		&:last-child {
			border: none;
		}

		.li {
			width: 92%;
			height: 100upx;
			padding: 0 4%;
			border-bottom: 1px solid rgb(243, 243, 243);
			display: flex;
			align-items: center;

			&.noborder {
				border-bottom: 0
			}

			.icon {
				flex-shrink: 0;
				width: 50upx;
				height: 100upx;
				line-height: 100upx;

				image {
					width: 50upx;
					height: 50upx;
				}
			}

			.text {
				padding-left: 20upx;
				width: 100%;
				color: #666;
			}

			.to {
				flex-shrink: 0;
				width: 40upx;
				height: 40upx;
			}
		}
	}
</style>
